home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
jpi
/
maped.frm
< prev
next >
Wrap
Text File
|
1997-12-24
|
9KB
|
311 lines
VERSION 5.00
Begin VB.Form Form1
Caption = "TerrainEditor"
ClientHeight = 6495
ClientLeft = 3135
ClientTop = 1650
ClientWidth = 9375
LinkTopic = "Form1"
ScaleHeight = 433
ScaleMode = 3 'Pixel
ScaleWidth = 625
Begin VB.ListBox List1
Height = 840
Left = 6600
TabIndex = 22
Top = 3600
Width = 1935
End
Begin VB.CommandButton Command3
Caption = "Refresh"
Height = 255
Left = 6600
TabIndex = 21
Top = 3240
Width = 855
End
Begin VB.CommandButton Command2
Caption = "Open"
Height = 255
Left = 4920
TabIndex = 20
Top = 5040
Width = 1095
End
Begin VB.TextBox Text4
Height = 285
Left = 3480
TabIndex = 18
Text = "1"
Top = 5400
Width = 1335
End
Begin VB.TextBox Text3
Height = 285
Left = 3480
TabIndex = 16
Text = "1"
Top = 5040
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "Save"
Height = 255
Left = 4920
TabIndex = 15
Top = 5400
Width = 1095
End
Begin VB.Frame Frame2
Caption = "Frame2"
Height = 1695
Left = 6600
TabIndex = 10
Top = 1440
Width = 1935
Begin VB.OptionButton Option2
Caption = "Level"
Height = 255
Index = 2
Left = 120
TabIndex = 13
Top = 720
Width = 1695
End
Begin VB.OptionButton Option2
Caption = "Shrink"
Height = 255
Index = 1
Left = 120
TabIndex = 12
Top = 480
Width = 1695
End
Begin VB.OptionButton Option2
Caption = "Grow"
Height = 255
Index = 0
Left = 120
TabIndex = 11
Top = 240
Width = 1695
End
End
Begin VB.Frame Frame1
Caption = "Frame1"
Height = 1215
Left = 6600
TabIndex = 7
Top = 120
Width = 1935
Begin VB.OptionButton Option1
Caption = "Gold"
Height = 255
Index = 2
Left = 120
TabIndex = 14
Top = 720
Width = 1695
End
Begin VB.OptionButton Option1
Caption = "Water"
Height = 255
Index = 1
Left = 120
TabIndex = 9
Top = 480
Width = 1695
End
Begin VB.OptionButton Option1
Caption = "Grass"
Height = 255
Index = 0
Left = 120
TabIndex = 8
Top = 240
Width = 1695
End
End
Begin VB.VScrollBar VScroll1
Height = 4455
LargeChange = 8
Left = 6240
Min = 2
SmallChange = 2
TabIndex = 6
Top = 120
Value = 2
Width = 255
End
Begin VB.HScrollBar HScroll1
Height = 255
LargeChange = 8
Left = 120
Min = 2
SmallChange = 2
TabIndex = 5
Top = 4680
Value = 2
Width = 5895
End
Begin VB.TextBox Text2
Height = 285
Left = 1080
TabIndex = 3
Text = "50"
Top = 5400
Width = 1335
End
Begin VB.TextBox Text1
Height = 285
Left = 1080
TabIndex = 1
Text = "50"
Top = 5040
Width = 1335
End
Begin VB.PictureBox Picture1
BackColor = &H00000000&
Height = 4500
Left = 120
ScaleHeight = 296
ScaleMode = 3 'Pixel
ScaleWidth = 396
TabIndex = 0
Top = 120
Width = 6000
End
Begin VB.Label Label4
Caption = "Level"
Height = 255
Left = 2760
TabIndex = 19
Top = 5400
Width = 615
End
Begin VB.Label Label3
Caption = "Episode"
Height = 255
Left = 2760
TabIndex = 17
Top = 5040
Width = 615
End
Begin VB.Label Label2
Caption = "Map Height"
Height = 255
Left = 120
TabIndex = 4
Top = 5400
Width = 975
End
Begin VB.Label Label1
Caption = "Map Width"
Height = 255
Left = 120
TabIndex = 2
Top = 5040
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Call SaveMap(Val(Text3.Text), Val(Text4.Text))
End Sub
Private Sub Command2_Click()
Call LoadMap(Val(Text3.Text), Val(Text4.Text))
Call RenderView
End Sub
Private Sub Command3_Click()
Call RenderView
End Sub
Private Sub Form_Load()
Open "Original.Ion" For Input As #1
Do
Line Input #1, a$
If a$ = "[OBJECTDEFSTART]" Then
Line Input #1, a$
Line Input #1, a$
List1.AddItem MapEdit.GetPropertyValue(a$)
End If
If a$ = "[ENDOFFILE]" Then Exit Do
Loop
Close #1
ViewX = 1
ViewY = 1
MaxX = Val(Text1.Text)
MaxY = Val(Text2.Text)
HScroll1.Max = (MaxX - ViewWidth) * 4
VScroll1.Max = (MaxY - ViewHeight) * 4
Form1.Show
DoEvents
For X = 1 To 100 'ViewX To ViewX + ViewWidth
For Y = 1 To 100 'ViewY To ViewY + ViewHeight
GroundBlocks(X, Y).TerrainType = 0
Call ChangeHeight(X, Y, Int(4 * Rnd))
Next Y
Next X
Call MapEdit.RenderView
Picture1.Height = ViewHeight * HalfBlockSize
Picture1.Width = ViewWidth * BlockSize
End Sub
Private Sub HScroll1_Change()
ViewX = HScroll1.Value / DivVal1
Call MapEdit.RenderView
End Sub
Private Sub List1_Click()
If List1.ListIndex <> -1 Then DropItem = True
End Sub
Private Sub Option1_Click(Index As Integer)
CurrTerrain = Index
End Sub
Private Sub Option2_Click(Index As Integer)
TerrMoveMethod = Index
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then Call DropGroundType(X, Y)
If Button = 1 Then
If DropItem = True Then
Call GenItem(List1.List(List1.ListIndex), X, Y)
List1.ListIndex = -1
DropItem = False
Else
Call Terrainmove(X, Y, TerrMoveMethod)
End If
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 T